package com.wontube.smr.web.pub;

import java.io.Writer;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import freemarker.core.Environment;
import freemarker.template.TemplateException;
import freemarker.template.TemplateExceptionHandler;

/**
 *  
 * @author tanggf(2012-4-23)
 *
 */
public class FreemarkerExceptionHandler implements TemplateExceptionHandler {
	private final static Logger logger = LoggerFactory.getLogger(FreemarkerExceptionHandler.class);

	@Override
	public void handleTemplateException(TemplateException te, Environment env,
			Writer out) throws TemplateException {
		logger.error("errors happen when processing freemarker template", te);
		throw te;
	}
}
